#!/usr/bin/csh

setenv PYTHONPATH /opt2/LogCatcherTool
set CMDF = "python common_script.py "

clear
date
echo "-- Common Script v1.0 Start --"

echo "-*******************************************-"
echo "The process is displayed while operating now. "
echo "-*******************************************-"
echo ""
echo -n "Input target ne group (1.SBTM, 2.SBB) : "
set gname = $<
switch ( $gname )
  case "1"
    echo "   *** For SBTM ***"
    touch ./ip_sbtm.txt
    cp ./ip_sbtm.txt ./ip.txt
    breaksw
  case "2"
    echo "   *** For SBB ***"
    touch ./ip_sbb.txt
    cp ./ip_sbb.txt ./ip.txt
    breaksw
  default:
    echo "script end."
    date
    exit
endsw

echo "--------------------------------------------------------"
echo "           Please Check all execute Command             "
echo "--------------------------------------------------------"

foreach fname (`find ./common_cmd/*.txt -size +0`)
echo '*****' $fname '*****'
cat $fname
end

echo ""
echo ""

while 1
  echo "--------------------------------------------------------"
  echo "        Starting common script, Are you sure?           "
  echo "--------------------------------------------------------"
  echo ""
  echo -n "Input < y or n , q is stopped > : "
  set gyn = $<
  switch ( $gyn )
    case "y"
      goto start
      breaksw
    case "q"
      echo "script end."
      exit
      breaksw
    case "n"
      echo "script end."
      exit
      breaksw
  endsw
end

start:
echo "-*******************************************-"
echo "-               Script  Start               -"
echo "-*******************************************-"

$CMDF

sleep 1; echo ""
sleep 1; echo ""
echo -n "  -- Thank you for your help.  " ; date
echo ""

